
import Teste.Usuario;
import java.io.IOException;
import java.net.Socket;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author juan__000
 */
public class TEste {
    public static void main(String[] args){
        Usuario u=new Usuario();
        System.out.println("Digite o nome:");
        Scanner k=new Scanner(System.in);
        String nick = k.next();
        try {
            u.conecta();
            System.out.println("Conectado");
           // u.aguardaInicio(nick);
            int id = u.entrada.readInt();
            u.saida.writeObject(nick);
            System.out.println("Partida inicializada");
            Object o= u.entrada.readObject();
            while(true){
                k.next();
                u.saida.write(id);
                System.out.println("Enviando...");
                u.saida.writeObject(o);
                System.out.println("Objeto Enviado");
            }
        } catch (IOException | ClassNotFoundException ex) {
            Logger.getLogger(TEste.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        
        
    }
}
